Note: "suntar" does NOT mean computers by Sun Microsystems, it's "Speranza's un-tar" since it extracts tar archives (i.e. un-tars their contents) created on any UNIX machine (including Sun, but also IBM, HP and others). The application icon is only a graphical joke which does not want to represent the Sun logo.
What's suntar ?
Suntar is the cheapest way to transfer data between a Macintosh and an UNIX workstation, if a few hardware requirements are met.
Starting from version 1.2 suntar is also a MacBinary, BinHex and PackIt extractor hence it may be moderately useful even to people without access to UNIX machines.
To understand what it does, it's useful to tell how the whole thing started: we had just got the new, wonderful Macintosh LC, but one of us is a student and at the University he had to work on a Sun SPARCstation 1: is it possible to communicate data between the two machines, without using a network or a modem ? The SPARCstation has a 3.5" disk drive, why shouldn't it be possible to save a file on a floppy disk at the University and read it back on our Mac, or vice-versa ? That would be useful both for working (typing a C program at home before compiling it on the Sun) and downloading Mac files from all those ftp-able places in the world.
The Apple SuperDrive can read and write disks in the two IBM formats, 720K and 1440K with MFM encoding: for simplicity and compatibility, all 3.5" drives manufacturers have adopted this de-facto standard, hence there should be no difficulty to read a disk written on any UNIX workstation on a Macintosh with a SuperDrive. Unfortunately, for a while Apple did not adhere to that standard, the 400K and 800K drives used exclusively an Apple proprietary physical encoding called GCR which can't be read or written on a non-Apple disk drive.
But the SuperDrive is compatible, and it's present on all most recent Mac models: that is the IIx, IIcx and later models of the series II, the SEs built after September 89 or upgraded with a FDHD kit, the SE/30, Portable, Classic, LC, PowerBooks and Quadras: today, all Macintosh models in production have a SuperDrive.
Furthermore, the ancient UNIX hasn't learned yet about floppy disk drives: they must be set up to emulate a tape drive unit, handled by the tar utility. That's good for us, since tar uses a simple, standard format: no allocation tables, inodes and other complex, nonportable data structures, files are stored sequentially preceded by a simple header containing their name and a few informations; for directories, there is only the header, contained files are stored separately, using the partial path name from the directory you specified.
So, we wrote suntar, a program which runs on a Macintosh and reads and writes a disk in the physical IBM formats containing data in the logical tar format; thinking that it could be useful to many students having the same problem, we added more features, made it easier to use and released it in the public domain.
Usually, we launch suntar and let it perform extractions in background: almost all files arrive with their proper icon and are double-clickable. It's easy to use an application which may recognize file formats without requiring that you tell it which "filter" must be used for each file !
Really, there are three different floppy disk formats you may use on an UNIX workstation in order to exchange data with a Mac:
1) the Macintosh format: we' ve read on a magazine about two commercial programs which, running on UNIX workstations, should read and write disks in Macintosh format. We have no information about the price and features of such programs, hence we can't judge their fitness to your needs
2) the MS-DOS format: the public domain package "mtools" can read and write in the MS-DOS format under UNIX, and Apple File Exchange can then move the data to your Mac. Inconveniences of such approach are: to move files bigger than a disk is possible but annoying (you must split them); you have no support for Macintosh specific file formats (for example, AFE can translate a MS-DOS ASCII text to a Mac ASCII text, but you must disable such conversion on UNIX files, and convert later); lastly, the portability of UNIX programs is a myth, you get a public domain package in source code but you need the help of an experienced programmer to have it compiled and running.
3) the UNIX formats, that is tar and bar formats. Suntar can read and write such archives, and performs all the most useful file conversions while doing it.
Under UNIX, tar may be used for three purposes:
1) to perform regular back-ups on tape, to be stored and hopefully never used; or to archive rarely used files off-line, on a medium which is cheaper and more capable than a hard disk: that's where the name tar (Tape ARchiver) originally came from.
2) to put together several files into a single file, which may be easier to manage, expecially if you wish to compact it (both the old pack utility and the new compress generate one compressed file per input file).
3) it's the simplest way, and sometimes the only way, to create a physical medium which can be used to distribute programs and data to other computer users.
Suntar was conceived to be mainly a communication program, role 3, allowing Macintosh users to exchange data with UNIX users. It can be used for backups, role 1, but it can't compete with applications written as backuppers. If you happen to have a .tar file on a Macintosh you may extract it by suntar, but to perform role 2 in tar format you should rather use Craig Ruff's tar: it's a public domain Macintosh program, the 3.0 version has added the capability to read/write from an UNIX floppy disk, but in that role it's less powerful than the older suntar 1.0: that is, the roles of tar 3.0 and suntar 1.3 are slightly overlapped, but since both programs are free you may get both.
What you need
To exchange data is a difficult art: if you want to fully exploit suntar you should have some basic notions about Mac files: data and resource forks, the MacBinary format (a common way to store a Mac file in an UNIX-style file without losing informations) and so on.
Furthermore, you should know that in text files UNIX separates lines by a Line Feed character while the Mac uses a Carriage Return (MS-DOS uses a CR followed by a LF, just to be incompatible with both).
If your purpose is to download files from ftp-able public domain archives, you should have a bunch of public domain programs to convert file formats:
¥ .bin files (and all non-ASCII formats) are MacBinary files, directly converted by suntar; you should not need any of the many small utilities performing the conversion, such as BinHex 5.0 (which is a totally different program from BinHex 4.0)
¥ .hqx files may be converted (usually yielding a .sit or .pit) by suntar itself, by BinHex 4.0 or StuffIt, Compact Pro, Downline or many small utilities. Only a few of these programs (e.g. the DA BinHqx) can decode files splitted in several parts, and suntar can't: if you get a set of parts, you may use United or Unity (or any text editor which accepts very large files) to put all parts together (without any extra text: suntar skips lines such as '----- end of part 1' only if they are before any BinHex data)
¥ .pit files were created by PackIt, but StuffIt and Downline too support them, and there is a freeware Unpit. Starting from version 1.2, suntar too can extract them by the "Open file" command
¥ .sit files are almost a standard, recognized by several compression programs on the Mac: their originator (StuffIt 1.5.1) or Compact Pro, Disk Doubler and Downline. However, StuffIt has now evolved to a commercial version, StuffIt Deluxe, with new, incompatible compression methods. Deluxe archives may be extracted by Stuffit Classic 1.6 (shareware) or UnStuffIt Deluxe (freeware), but StuffIt Deluxe 3.0 has more new methods and StuffIt Expander is the only freeware which may decode all of them
¥ .cpt files were generated by Compact Pro (once called Compactor); the extract-only versions (cptExpand and Extractor) are freeware. StuffIt Expander too should be able to expand cpt files
¥ .sea files were created by Compact Pro (or other compression programs), but they self-extract themselves when you double-click them
¥ .gif files are a non-Mac graphical format, supported by many Mac applications and DAs: suntar assigns them the correct type so that graphics programs may recognize them more easily.
If you exchange UNIX files instead of Mac files, you'll need MacCompress which is compatible with the UNIX utility compress (.Z files). You might need unshar (to extract .shar files). Uutool and other utilities are compatible with uuencode/uudecode but beware, we've seen at least two Mac uudecoders which forgot to open the files in binary mode, and you know what happens to binary files in ASCII mode.
Finally, DeskZap 1.32 is always handy to change file type and creator, set the bundle bit (some programs come with an icon which is not shown by the Finder because the author has forgotten to set the bundle bit) and perform simple file format conversions (DeskZap 2.0 is more powerful but we don't like its new user interface), and the desk accessory System Errors may tell you the meaning of error codes which suntar prints when something is wrong.
Instructions, UNIX side
You must know the device name of the floppy disk: it's "/dev/rfd0" on a Sun 3, SPARCstation or IBM RISC/6000 (which autosense the density), on Sun 386i it's /dev/rfd0 or /dev/rfdl0 according to the density (1440 or 720k), on other machines it might be /dev/rdsk, /dev/rfp, /dev/rflp, and other characters may be optionally appended meaning the currently used density. That initial 'r' is another attribute (raw), /dev/fd0 is the same device but it's accessed with more software overhead. UNIX should tell you the right name when you type "man fdformat" or "man -k disk", otherwise you may ask to your system administrator, or try to explore the /dev directory (devices usually need no special privilege, and all UNIX commands including cat may access them).
You may use disks formatted on the UNIX workstation, on an IBM PS/2 or on the Mac, either under suntar itself or Apple File Exchange or the Finder (1440K only).
Beware: MS-DOS and System 7 have a feature that allows you to use disks having bad sectors, by marking them in the allocation table. A tar disk has no allocation table, any bad sector will be used for data if the archive is long enough to reach that sector. Hence, if you have doubts about the quality of your disks you should initialize them under System 6 or suntar, where initialization fails if there are any bad sectors. Suntar 1.3 alerts you if a disk contains sectors marked bad by System 7, but not by MS-DOS; the UNIX command fdformat does not verify the disk.
On the SPARCstation, the typical operations are performed as follows.
Formatting (it requires no parameters):
fdformat
Write one or more files or directories:
tar cvf /dev/rfd0 filenames
(use the proper name in place of rfd0, and write the list of files and directories in place of "filenames" )
Append:
tar rvf /dev/rfd0 filenames
List:
tar tvf /dev/rfd0
Extract:
tar xvf /dev/rfd0
Copy a .tar file (shorter then the disk) to a disk:
cat filename.tar >/dev/rfd0
Refer to the manual of your system for differences and for other options, or use "man -k disk" for the online help, if it's installed. Obviously, there are many ways to avoid typing those easy-to-forget parameters and any old UNIX user will tell you about them.
The original tar utility can't create an archive longer than a single disk, maybe that was a reasonable limit on tapes but it's not on floppy disks, we happened to download more than 10 MegaBytes of public domain files at one time (or a single file of more than 4 Mbytes) and to manually distribute files among the disks, without exceeding the 1440K limit on each, is really tedious; to split files bigger than 1440K is even more tedious.
Using multi-volume archives is almost a necessity. Any multi-volume program allows an archive to span any number of disks, when a file does not fit in a disk it writes as much data as fits and continues writing the remaining data onto another disk. The splitted files will be recombined when extracting. There are at least three different multi-volume formats (two different extensions of tar and a new program), and all these three formats are fully supported by suntar.
The non-tar program is bar, which might be part of the set of utilities which came with your UNIX (on the SPARCstation it's so). Bar generates archives in a format similar to the tar format, but data fields are placed in a different order, hence the two formats are incompatible. To run bar, simply replace tar by bar in previous examples. Really, bar was badly designed (if a data field happens to be written in a wrong way one should correct the problem, not let the extraction routine ignore that field), and the documentation of its format is full of errors, but according to our experience suntar succeeds to read bar archives without problems.
The tar version bundled with AIX for the IBM RISC/6000 has a multi-volume format, which requires no special parameters to be used. But remember that only the first disk has an header in a fixed place, hence AIX tar is the only format which obliges you to always insert all the disks in the right order (you should always place a label on the disks with the archive name and disk number, since those informations are not stored inside). Single volume archives generated by AIX tar (or GNU tar, without the V option) are fully compatible with any version of tar, the difference arises only for archives composed of more than one disk.
Then there is the GNU tar. GNU is an association which freely distributes a set of UNIX utilities compatible with the original ones, in source code: you may get them by anonymous ftp at prep.ai.mit.edu. The GNU version of tar has a few extra options, by specifying M it allows multi-volume archives (that is, type cvfM, rvfM, tvfM, xvfM as parameters); an extra parameter V may be used to assign a sequence number to disks . GNU tar does not eject the disks when they are full, hence if the drive hasn't an eject button you must have a shell prompt to issue the eject command. When GNU tar is waiting, you may type ? to get help and ! to get a sub-shell, but if you are annoyed of that you may edit the source of tar so that the function "new_volume" in buffer.c looks like this:
...
else for(;;) {
{ /*addition by Sauro Speranza, 24 oct 1991 and 2 apr 1992 */
int len = strlen(ar_file);
while(ar_file[len-1] != '/' && len > 0) len --; /* strrchr is not always available */
fprintf(msg_file,"\007Prepare volume #%d and hit return: ",volno);
...
If you want GNU tar and your tar does not come from GNU (if it does, "tar +version" will print a copyright notice), remember to get the help of an experienced programmer, the source code was written to be portable among several machines (even MS-DOS) but you must taylor some #define's to your system and maybe find where some .h files are; and if your C compiler follows the ANSI standard, disable all the new features: portability of source code for UNIX systems is not perfect, it's difficult to do better than that.
Instructions: Macintosh side
If you are using System 7 and are satisfied by short descriptions of the commands, turn on balloon help; otherwise, read here.
The usual way to begin to work is by inserting a disk: suntar realizes that it's neither a Mac nor a MS-DOS disk and "opens" it for itself. Otherwise, you may select a command (e.g. List) and suntar will ask you to insert a disk, inconditionally opening it as a tar/bar archive.
The first command in the File menu is "Get file info", it may be used to get informations about any file, but it's more useful for files which suntar may open.
Then there is the usual Open, but its use is not usual: it performs some operations which are not essential for suntar but may be useful. You may open a tar or bar archive which is stored in a Macintosh file on a Macintosh volume, or convert files in one of the following formats: MacBinary, BinHex 4.0, UNIX-wise ASCII (that is, using LF) and PackIt (even compressed PackIt archives, but not encrypted ones). Suntar automatically recognizes the file format, and that should be good in most cases, but you may change that by a click on a checkbox.
Copy disk archive to file copies all data found on a disk to a Mac file in the tar format (readable by tar 3.0 or suntar itself) or in the bar format (readable by suntar); for multi-volume archives, the extra volume headers on disks other than the first one are skipped, so you get a single-volume archive, but no other data conversion is performed.
The Eject command may be used when you no more need the disk, but most commands eject the disk when finished. Anyway, it's not a good idea to keep a non-Mac disk in a drive for a long time, expecially under MultiFinder. The usual command-shift-1 and command-shift-2 still eject the disk, but suntar doesn't realize that the disk is no more there: use Eject or its shortcut command-W instead (that means that you can't run suntar from a floppy disk if you have a single drive).
List prints the list of the files in the tar or bar archive.
"Extract and convert" is the most useful command and the most frequently used. It reads files from the archive and saves them on the Macintosh. However, Macintosh files are different from UNIX files: they are composed of two parts (the data and resource forks) and their attributes are essential (you can't execute an application if its type is not 'APPL', nor extract a StuffIt archive if it's not 'SIT!'); even pure text files are different, using CR rather than LF (see above). To make things easy, suntar recognizes the most common file formats and automatically converts them to the Macintosh form. That includes pure text files and the two formats used by public domain archives, MacBinary (in three variants) and BinHex (.hqx files); in most cases, you get exactly what you want without having to worry about which conversions must be done.
"Extract selected files" is like Extract, but allows you to choose which file must be extracted from a scrollable list; shift-click is used to add new files to the current selection. A "Find" button allows you to select names containing a given string (for example, if you want to extract all .c and .h files, just use Find twice with those strings).
A note for AIX users: usually suntar allows you to insert any disk of the archive, but that's impossible with the AIX format. Hence, to extract selected files from the second disk you must insert the first disk, click on the Extract button when no file is selected, then insert the second disk. You must have set the "tar version" option to AIX, otherwise suntar will not ask for the second disk.
The two Create commands allow you to start a new archive, overwriting anything was previously on the disk (in Mac style, you may get a few warnings before loosing any data; in order to reduce unintentional data loss, suntar writes any volume header only after you choose the first file to be written).
Append is similar but preserves the current contents of the tar/bar archive, adding new files after the existing ones (AIX users must insert all the disks of multi-volume archives, GNU tar and bar users must insert only the last one).
Anyhow, when you are in write mode you select commands in the Write menu and the familiar standard file dialog appears: the Write button allows you to select whole folders, it's equivalent to Open for single files. Choose End of write (or Eject or Abort or Quit) when you have finished.
Files can be written in three different formats: MacBinary saves all the data of a Mac file (using the MacBinary II format, which can be read also by programs which know only about the original MacBinary), ASCII saves the data fork only converting any CR to LF, Data fork only must be used for files already in UNIX format. Lastly, write tar (or bar) file does the reverse of Copy disk archive to file, appending the contents of the tar (or bar) file to the archive, without any conversion.
Initialize is like the Initialize command in the Finder, but disks which do not support 1440 Kbytes (have no hole...) are formatted at 720K, a format more suitable to exchange data with UNIX machines; if the relative option is set they are initialized in a way that is completely Finder compatible.
Pause and Abort are what you expect, but you'll be surprised to find them in a menu, in most programs they are missing or are buttons. Well, suntar allows you to pull down menus even when it's working, even when it's performing very low level operations, directly talking to device drivers. That can be very useful, and working in background under MultiFinder saves time, but it may be dangerous: as any UNIX application, suntar knows only a drive number, not a disk name: if you eject the tar disk from outside suntar (or you use command shift-1, or the Finder ejects it with its usual change disk dialog or the Eject button in the standard file dialog) and insert a Macintosh disk, suntar will not notice the difference, and if you do that while suntar was writing and the second disk contains the only copy of your most precious data... To avoid that, you may pause suntar, eject the disk and then insert it back: if suntar is in foreground it will ask you whether that's the same disk it was working on.
At any time you may change the preferences settings, to become active at next file (the best moment to do that is during the confirm saves dialog), or resize the window.
Similarly, you may select any enabled command during semimodal dialogs: they look like modal dialogs, except for the window border, but behave differently: you may do anything while they are out, including switching to another task, moving the dialog and (by holding down the command key, as usual for non-front windows) moving the console window, but you can't hide one of them behind the console (Apple calls them "movable modal dialogs", but suntar's implementation has a different look, without title bars).
In the Preferences menu, the items in the central section are saved when you quit, the other items are "temporary only" and are reset to their initial state when suntar is launched.
Options calls the options box: use the balloon help for options which are not obvious. Anyway, only two options are essential (you should always assign them !): tar version (it tells suntar what to do about multivolume archives) and "text files creator": it's a four characters string which determines the icon of plain text files and the program which is launched when you double click them (EDIT for the Consulair Edit or its "compatible" Edit II, ttxt for TeachText, MACA for MacWriteÉ you may use Get File Info to discover the string for your favourite editor, Copy the string from the console and Paste it in the options box).
Other rarely used options (buffer sizes, background priority, uid, gid...) are stored in the application as 'STR ' resources and may be changed by using ResEdit.
The ".hqx prefs" submenu is useful if you often download BinHex files. The problem with such files is that they are plain text files. That's good since they may be sent as E-mail and transferred also in the default mode of ftp, without switching to binary mode, but it's bad since they can be, and usually are, edited before arriving at you. So, they may contain extra text or be incomplete: you may disable conversions if suntar fails to extract them and you wish to try again with a specific program. Usually, before the BinHex data there is some text: sometimes it's the only user manual for the application or INIT in the file (and an INIT has no about box and no menus...), other times it's totally useless; so you may want to save that text in a file, or see it on the console, or simply skip it.
Select Expert mode and suntar will show some new preferences and a new menu: in this "Special" menu "Find headers" is essentially a "find all files, including lost and deleted ones", "Read tar at sector" recovers them, see balloon help for the other commands. Anyway, since MacTools, the Norton Utilities, the freeware FLUT and other disk utilities will not recognize a tar disk, it's reassuring to know that suntar has some undelete capabilities for disks which crashed or were partly overwritten.
English selects the language of messages (Italian or English, the default depends on the national version of your System file).
"Confirm saves" is used during an "Extract and convert" and allows you to extract only some files from an archive: it is a three-state item, clicking on the buttons "Skip all" or "Save all" puts it in a temporary state, you may return to the normal state by choosing it again.
Suntar and System 7.0
Suntar 1.3 is not System 7.0 savvy, but do you really need publish/subscribe and inter-application communication in such a small utility ? Anyway it provides balloon help for menu commands and for the most commonly used dialogs, it may background, it's 32 bit clean and sometimes exploits the new features (and avoids the new bugs) of System 7.0.
It recognizes aliases. All pre-System 7 back-uppers and archivers can resolve aliases when you choose them directly by the standard file dialog, but if you select a folder and it contains an alias, what goes into the archive is a 500 to 700 bytes file which says to the Finder where the true file or folder is. Obviously, it's useless to upload such informations to an UNIX machine, hence suntar usually resolves any aliases it finds (but an option allows you to disable that).
Finally, we've tried to find a reasonable way to handle the changed meaning of some informations about files (if you are the author of an archiver or an application supporting MacBinary II, you might wish to contact us, until there will be an official rule about Finder flags 10 and 15).
Copyright notice
Suntar (Speranza's un-tar) is freeware, so you may freely distribute it and send it to other public domain archives. If you send it to an archive which is more easily accessible from UNIX machines than from the Mac, you should send it in both forms, the StuffIt archive for who can download it and the uuencoded file (which includes instructions to use it) for those who need to "bootstrap" their communication link between UNIX and the Mac, by creating a Mac disk containing suntar using only UNIX utilities and a 3.5" disk drive connected to an UNIX machine. Some archives might wish to store also the file which allows to perform the bootstrap from an MS-DOS machine.
The color icons were sent us by Mark Duffield who edited and colored the icons we had designed.
Suntar was written in Think-C 4.0.5; the 1.0 version used Symantec's ANSI standard library, but starting from the 1.1 version suntar has a user interface library of its own, built from demo programs by Symantec (MiniEdit.c) and Apple Computer (TESample.c), with a lot of original additions.
We are going to lose access to the Internet. Sauro will graduate next month: he hopes to maintain an E-Mail address for a few months after that, and an update could be sent from a machine of somebody else, but don't expect that our support of suntar will last for a long time. We hope that the public availability of the source code will alleviate the problems created by an orphan application.
You may help us to make suntar better by sending your bug reports, suggestions and questions to:
mail address:
Sauro & Gabriele Speranza
via Cappuccini 18
40026 Imola
Italy
(yes, it's the town where a Formula 1 grand Prix takes place)
E-mail in INTERNET (till it lastsÉ)
Sauro Speranza
speranza@cirfid.unibo.it (preferred)
or: speranza@cs.unibo.it
Letters from previous users have reported successful use of suntar in exchanging data with the following machines:
Sun SPARCstation 1, 1+, 2, IPC, IPX
IBM RISC/6000
Solbourne S4000
HP 9000 model 370 with HP9122A or HP9153B drive unit
a Sony News workstation
users of other machines had problems, but the problems arised before succeeding to move suntar to a Macintosh, hence by now the list of incompatible machines is empty.
On the Macintosh side, having a Superdrive is the only requirement, and an external unit should be good; we don't know about unusual devices connected to the Mac such as 5.25" disk drives, tape units and those third-party 1440K drives connected through SCSI. Suntar should be compatible with the Mac Plus, but without a SuperDrive you can't exchange data with an UNIX machine.